import RoleClass from "./Role.js";

export default class XNF_DATA{



    //数据类

    static MAIN_EVENTHANDLER_(runtime){

    }


    static INIT_EVENTHANDLER(runtime)
    {

        this.INIT(runtime)
    }



     static INIT(runtime)
     {
            XNF_DATA.key={

                SAVE:"F3",
                LOAD:"F4",

            }
            XNF_DATA.SAVE_PATH_="main"

     }




    static DATA_listener={


        onGameLoad(e)
        {
            XNF_DATA.DATA_.loadGameData(e)
        },

        onGameSave(e){
            XNF_DATA.DATA_.saveGameData(e)
        },

        KEY_DOWN(e,runtime)
        {
           if(e.code===XNF_DATA.key.SAVE)
           {
               runtime.callFunction("SAVE_GAME","a")
           }

            if(e.code===XNF_DATA.key.LOAD)
            {
                runtime.callFunction("LOAD_GAME","a")
            }

        }


    }



    static DATA_={


       initialDATA_: function(){

           },




        loadGameData: function(e){
            console.log("---load game data ---")

            // 数据
           RoleClass.PROPERTIES.ACTION_POINT  =  e.saveData.ROLE_ACTION_POINT;

        },

        saveGameData: function(e){
            console.log("---save game data ---")

            // 数据
            e.saveData  =  {
                "ROLE_ACTION_POINT": RoleClass.PROPERTIES.ACTION_POINT,

            };


        }




    }







}